package pms;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.joda.time.DateMidnight;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
 
public class InfoGenerator {
   /* public static void main(String[] args) {// main for generating hours info
        	Database db;
			try {
				db = new Database();
        	DateTimeFormatter dft = DateTimeFormat.forPattern("yyyy/MM/dd HH:mm:ss");
        	DateTime workDate = new DateTime();
        	String text = "INSERT INTO hours (dateEntered,hoursWorked,startTime,endTime,employeeID) VALUES (";
     //note to self: this shit take an hour and 8 minutes to run
        	for(int i =0;i<365;i++){
	        	for(int j=1;j<142;j++){
	        		if(j!=5 && j!=6 && j!=12 && j!=13 && j!=15){
		        		double rand = Math.random();
		        		if(rand>.1){
		        			double hours = Math.random()*8;
		        			int employeeID = j;
		        			DateTime tempDate = workDate;
		        			String stringDate = tempDate.toString(dft);
		        			tempDate = workDate.plusHours((int)hours);
		        			String endTime = tempDate.toString(dft);
		        			String insert = text+"'"+stringDate+"', "+hours+", '"+stringDate+"', '"+endTime+"', "+employeeID+")";
		        			db.updateInfo(insert);
		        		}
	        		}
	        	}
	        	workDate = workDate.plusDays(1);
        	}
        	} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
    }*/
	
/*	public static void main(String[] args) throws SQLException, IOException { //main for generating random alerts
		Database db;
			db = new Database();
		DateTimeFormatter dft = DateTimeFormat.forPattern("yyyy/MM/dd HH:mm:ss");
		DateMidnight requestDate = new DateMidnight();
		String text = "INSERT INTO alerts (requestDate,startDate,endDate,employeeID,supervisorID) VALUES (";
	//note to self: this shit take an hour and 8 minutes to run
		for(int i =0;i<2;i++){
	    	for(int j=1;j<142;j++){
	    		if(j!=5 && j!=6 && j!=12 && j!=13 && j!=15){
		    		int supID=0;
		    		ResultSet rs = db.query("SELECT supervisorID FROM employeeInfo WHERE employeeID = "+j);
	        		supID = rs.getInt("supervisorID");
					
		    		int rand = (int)Math.random()*20;
	    			int days1 = rand;
	    			rand = (int)Math.random()*25;
	    			int days2 = rand;
	    			rand = (int)Math.random()*20;
	    			int weeks1 = rand;
	    			rand = (int)Math.random()*40;
	    			int weeks2 = rand;
	    			int employeeID = j;
	    			if(days1>days2&&weeks1<weeks2||weeks1<weeks2){
		    			DateMidnight tempDate = requestDate;
		    			tempDate = tempDate.plusDays(days1);
		    			tempDate = tempDate.plusWeeks(weeks1);
		    			String startDate = tempDate.toString(dft);
		    			tempDate = requestDate;
		    			tempDate = tempDate.plusDays(days2);
		    			tempDate = tempDate.plusWeeks(weeks2);
		    			String endDate = tempDate.toString(dft);
		    			String insert = text+"'"+requestDate+"', '"+startDate+"', '"+endDate+"',"+employeeID+", "+supID+")";
		    			db.updateInfo(insert);
		    		}
	    		}
	    	}
	    	requestDate = requestDate.plusDays(1);
	}
}*/}